<?php
	require_once('./config.php');
	session_start();
	if (!isset($_SESSION['authPassed']))
	{
		chkLoginStatus();
	}
	$action = isset($_GET['p']) ? $_GET['p'] : "";

	switch ($action) 
	{    	
  		case 'search':
  			include(THEMEPATH.'search.php');
  			break;
    		
  		case 'login':
  			include(THEMEPATH.'login.php');
  			break;

  		case 'logout':
  			include(THEMEPATH.'logout.php');
  			break;
  		
  		case 'reg':
  			include(THEMEPATH.'reg.php');
  			break;
  		
  		case 'viewUser':
    		include(THEMEPATH.'viewUser.php');
    		break;
  			
  		case 'editProfile':
  			include(THEMEPATH.'editProfile.php');
  			break;
  		
  		case 'uploadFile':
  			include(THEMEPATH.'uploadFile.php');
  			break;
  		
  		case 'editFile':
  			include(THEMEPATH.'editFile.php');
  			break;
  			
  		case 'viewAlbum':
  			include(THEMEPATH.'viewAlbum.php');
  			break;
  			
  		case 'editAlbum':
  			include(THEMEPATH.'editAlbum.php');
  			break;
  			
  		case 'uploadImage':
  			include(THEMEPATH.'uploadImage.php');
  			break;
  		
  		case 'viewTeam':
  			include(THEMEPATH.'viewTeam.php');
  			break;
  		
  		case 'editTeam':
  			include(THEMEPATH.'editTeam.php');
  			break;
  			
  		case 'editPwd':
  			include(THEMEPATH.'editPwd.php');
  			break;

  		case 'viewImage':
  			include(THEMEPATH.'viewImage.php');
  			break;
  		
  		case 'viewCompetition':
  			include(THEMEPATH.'viewCompetition.php');
  			break;
  			
  		case 'editCompetition':
  			include(THEMEPATH.'editCompetition.php');
  			break;
  			
  		case 'viewPost':
  			include(THEMEPATH.'viewPost.php');
  			break;
  		
  		case 'editPost':
  			include(THEMEPATH.'editPost.php');
  			break;
  			
  		case 'viewMessage':
  			include(THEMEPATH.'viewMessage.php');
  			break;
  		
  		case 'editMessage':
  			include(THEMEPATH.'editMessage.php');
  			break;
  			
  		case 'getInviteCode':
  			include(THEMEPATH.'getInviteCode.php');
  			break;
  		
  		case 'ranCode':
  			include(THEMEPATH.'ranCode.php');
  			break;
  			
  		default:
    		include(THEMEPATH.'index.php');
	}
?>